home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Rexx / SendText.term < prev    next >
Text File  |  1993-08-25  |  2KB  |  102 lines

  1. /*
  2.  *  Send a text file(s) to my SUN workstations, using 'ex' or 'vi', since
  3.  *  my zmodem uploading is broken.
  4.  *
  5.  *  written by Jonathan Springer
  6.  *
  7.  *  Filenames are stripped and stored in the current directory on the SUNs
  8.  *
  9.  *  Note that your xprASCII.library must be set up with large enough delays
  10.  *  between lines and/or characters that it doesn't overwhelm the receiving
  11.  *  system.
  12.  */
  13.  
  14. OPTIONS RESULTS
  15.  
  16. TIMEOUT 10
  17.  
  18. IF ~show('L', "rexxarplib.library") THEN DO
  19.     SAY 'Trying to find ''rexxarplib.library'''
  20.     IF ~addlib("rexxarplib.library", 0, -30, 0) THEN EXIT
  21.     SAY 'Found it'
  22.     END
  23.  
  24. /*  Set up your system prompt here  */
  25. sysprompt = 'screech.springjp> '
  26.  
  27. /*  Not used, since it breaks on single files :(
  28. REQUESTFILE TITLE '"Select Files to UpType"' MULTI STEM Files
  29. */
  30.  
  31. /*  Find out where TERM is  */
  32. GETATTR term.screen
  33. TermScreen = result
  34.  
  35. GetFile(,,,,'Select File(s) to UpType', TermScreen,'MULTISELECT',Files)
  36.  
  37. IF Files.0 = 0 THEN EXIT
  38.  
  39. /*  Get the files to be sent    */
  40.  
  41. SAY 'Parsing file list.'
  42.  
  43. DO i = 1 TO Files.0 /*    Use DO i=0 to Files.COUNT-1 with REQUESTFILE    */
  44.  
  45.     nummatches = FileList(Files.i, SubFiles, 'F', 'E')
  46.     IF nummatches = 0 THEN iterate i
  47.  
  48.     DO j = 1 to nummatches
  49.  
  50.     /*  Isolate the file name   */
  51.     FileList(SubFiles.j, DumbStem, 'F', 'N')
  52.     partfile = DumbStem.1
  53.     SAY partfile
  54.  
  55.     drop DumbStem
  56.  
  57.     /*  Send them    */
  58.  
  59.     DELAY 2
  60.     SEND '\r'                       /*  Set things in motion.   */
  61.  
  62.     WAIT sysprompt
  63.     DELAY 1
  64.     SEND 'ls\r'
  65.  
  66.     TIMEOUT 2
  67.     WAIT partfile
  68.     IF rc = 0 THEN DO
  69.         TIMEOUT 10
  70.         WAIT sysprompt
  71.         ITERATE j            /*  File exists         */
  72.         END
  73.     TIMEOUT 10
  74.  
  75.     DELAY 1
  76.     SEND '\r'
  77.     WAIT sysprompt
  78.     DELAY 1
  79.     SEND 'vi ' partfile '\r'        /*  Start up the editor     */
  80.  
  81.     DELAY 2
  82.     SEND ':set noautoindent\r'      /*  Just in case :)         */
  83.     DELAY 1
  84.  
  85.     SEND 'i'                        /*  Insert mode...          */
  86.  
  87.     DELAY 1
  88.  
  89.     SENDFILE MODE ASCII NAMES SubFiles.j
  90.  
  91.     DELAY 1
  92.  
  93.     SEND '\e'                       /*  Escape Insert mode      */
  94.     DELAY 1
  95.  
  96.     SEND 'ZZ'                       /*  And exit vi.            */
  97.  
  98.     END
  99.     END
  100.  
  101.     /*    That's all folks.   */
  102.